package test.my.com.myapplicationtest.zhe_xian_tu_view.DynamicPathView.draw.DrawControl;

import android.content.Context;
import android.graphics.Canvas;

import test.my.com.myapplicationtest.zhe_xian_tu_view.DynamicPathView.draw.model.TextModel;


/**
 * Created by qinghua on 2015/8/7.
 */
public class TextControl extends DrawControl {

    private TextModel textModel;
    private Context mContext;

    public TextControl(Context context, Canvas canvas, TextModel textModel) {
        super(canvas);
        this.textModel = textModel;
        this.mContext = context;
    }

    @Override
    public void beginDraw() {
        paint.setColor(textModel.getColor());
        paint.setTextSize(textModel.getTextSize());
//        paint.setTypeface(FontUtil.getInstance(mContext).getTypeface());
        mCanvas.drawText(textModel.getTextContent(),textModel.getBeginX(),textModel.getBeginY(),paint);
    }
}
